package net.bezrabotnih.client.managed.ui;

import com.google.gwt.text.shared.AbstractRenderer;

import net.bezrabotnih.client.scaffold.place.ProxyListPlace;
import net.bezrabotnih.client.managed.request.ApplicationEntityTypesProcessor;
import net.bezrabotnih.client.managed.request.UserRatingProxy;
import net.bezrabotnih.client.managed.request.UserAccountProxy;

import net.bezrabotnih.client.managed.request.ThumbnailProxy;
import net.bezrabotnih.client.managed.request.PhotoProxy;
import net.bezrabotnih.client.managed.request.LoginActionProxy;
import net.bezrabotnih.client.managed.request.JobTypeProxy;
import net.bezrabotnih.client.managed.request.JobProxy;
import net.bezrabotnih.client.managed.request.CommentProxy;

/**
 * Renders {@link ProxyListPlace}s for display to users.
 */
public class ApplicationListPlaceRenderer extends AbstractRenderer<ProxyListPlace> {

	public String render(ProxyListPlace object) {
		return new ApplicationEntityTypesProcessor<String>() {

			@Override
      public void handleUserRating(UserRatingProxy isNull) {
        setResult("UserRatings");
      }
			@Override
      public void handleUserAccount(UserAccountProxy isNull) {
        setResult("UserAccounts");
      }
			
      
			@Override
      public void handleThumbnail(ThumbnailProxy isNull) {
        setResult("Thumbnails");
      }
			@Override
      public void handlePhoto(PhotoProxy isNull) {
        setResult("Photos");
      }
			@Override
      public void handleLoginAction(LoginActionProxy isNull) {
        setResult("LoginActions");
      }
			@Override
      public void handleJobType(JobTypeProxy isNull) {
        setResult("JobTypes");
      }
			@Override
      public void handleJob(JobProxy isNull) {
        setResult("Jobs");
      }
			@Override
      public void handleComment(CommentProxy isNull) {
        setResult("Comments");
      }
		}.process(object.getProxyClass());
	}
}
